package com.hfy.music.controller;

import com.hfy.music.service.MusicUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

/**
 * @ author 韩
 * time: 2024/6/4 17:40
 */

@RestController
@RequestMapping("/user")
@Tag(name = "音乐信息控制器",description = "主要负责音乐详细信息的查询")
public class MusicUserController {

    @Autowired
    private MusicUserService musicInfoService;



    @GetMapping("/music_num")
    @Operation(summary = "查询用户所喜欢的音乐数量")
    @Parameters(@Parameter(name = "account", description = "账号"))
    public Result getMusicNum(@RequestParam("account") Long account) {

        return musicInfoService.getMusicNum(account);

    }

    @GetMapping("/music")
    @Operation(summary = "查询用户喜欢的音乐清单")
    @Parameters(@Parameter(name = "account", description = "账号"))
    public Result getMusic(@RequestParam("account") Long account) {

        return musicInfoService.getMusic(account);

    }



}
